import codeanticode.vision.*;

CameraGrabber cam;
MovieRecorder rec;

void setup() {
  size(640, 480);
  cam = new CameraGrabber(this, 640, 480);
  cam.start();
  rec = new MovieRecorder(this, "output", 640, 480);
  rec.start();
}

void draw() {
  if (cam.read()) {
    image(cam, 0, 0, width, height);
    rec.record(cam);
  }
}

void keyPressed() {
  rec.stop();
  exit();  
}
